package com.swak.utils;

public class Longs {

	/**
	 * middle 如果不在 [lower, upper], 则取两端
	 * 
	 * @param lower
	 * @param middle
	 * @param upper
	 * @return
	 */
	public static long bound(long lower, long middle, long upper) {
		return Math.min(Math.max(lower, middle), upper);
	}
}
